package com.ghtmlx.client.grid;

import com.ghtmlx.client.menu.MenuObject;
import com.ghtmlx.client.util.DataType;
import com.ghtmlx.client.util.JavaScriptObjectHelper;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Image;

/**
 * User: j.voronin
 * Date: 20.01.2010
 */
public class GridObject extends JavaScriptObject {

    private static GridObjectImpl impl = new GridObjectImpl();

    protected GridObject() {
    }

    public final static GridObject create(Element container) {
        return impl.create(container);
    }

    public final void attachEvents() {
        impl.attachEvents(this);
    }

    public final void addRow(int row_id, Object[] dataArray) {
        impl.addRow(this, row_id, JavaScriptObjectHelper.convertToJsString(dataArray));
    }

    public final void addRowOnPosition(int row_id, Object[] dataArray, int index) {
        impl.addRowOnPosition(this, row_id, JavaScriptObjectHelper.convertToJsString(dataArray), index);
    }

    public final void adjustColumnSize(int cInd) {
        impl.adjustColumnSize(this, cInd);
    }

    public final void attachHeader(Object[] dataArray, String[] styleArray) {
        impl.attachHeader(this, JavaScriptObjectHelper.convertToJsString(dataArray), JavaScriptObjectHelper.convertToJsString(styleArray));
    }

    public final void attachToObject(JavaScriptObject obj) {
        impl.attachToObject(this, obj);
    }

    public final CellObject cellById(int row_id, int col) {
        return impl.cellById(this, row_id, col);
    }

    public final CellObject cellByIndex(int row_id, int col) {
        return impl.cellByIndex(this, row_id, col);
    }

    public final void changeRowId(int old_rowId, int new_rowId) {
        impl.changeRowId(this, old_rowId, new_rowId);
    }

    public final void checkAll(boolean mode) {
        impl.checkAll(this, mode);
    }

    public final void clearAll(boolean header) {
        impl.clearAll(this, header);
    }

    public final void clearAndLoad(String url, String type) {
        impl.clearAndLoad(this, url, type);
    }

    public final void clearSelection() {
        impl.clearSelection(this);
    }

    public final void collectValues(int column) {
        impl.collectValues(this, column);
    }

    public final void copyBlockToClipboard() {
        impl.copyBlockToClipboard(this);
    }

    public final void copyRowContent(int from_row_id, int to_row_id) {
        impl.copyRowContent(this, from_row_id, to_row_id);
    }

    public final void deleteRow(int row_id) {
        impl.deleteRow(this, row_id);
    }

    public final void deleteSelectedRows() {
        impl.deleteSelectedRows(this);
    }

    public final void destructor() {
        impl.destructor(this);
    }

    public final void detachEvent(String eventId) {
        impl.detachEvent(this, eventId);
    }

    public final void detachHeader(int index) {
        impl.detachHeader(this, index);
    }

    public final void doesRowExist(int row_id) {
        impl.doesRowExist(this, row_id);
    }

    public final void editCell() {
        impl.editCell(this);
    }

    public final void editStop(boolean mode) {
        impl.editStop(this, mode);
    }

    public final void enableAlterCss(String even, String odd) {
        impl.enableAlterCss(this, even, odd);
    }

    public final void enableAutoHeight(boolean mode) {
        impl.enableAutoHeight(this, mode);
    }

    public final void enableAutoHeight(boolean mode, int maxHeight) {
        impl.enableAutoHeight(this, mode, maxHeight);
    }

    public final void enableAutoHeight(boolean mode, int maxHeight, boolean countFullHeight) {
        impl.enableAutoHeight(this, mode, maxHeight, countFullHeight);
    }

    public final void enableAutoWidth(boolean mode) {
        impl.enableAutoWidth(this, mode);
    }

    public final void enableAutoWidth(boolean mode, int max_limit, int min_limit) {
        impl.enableAutoWidth(this, mode, max_limit, min_limit);
    }

    public final void enableBlockSelection(boolean mode) {
        impl.enableBlockSelection(this, mode);
    }

    public final void enableCellIds(boolean mode) {
        impl.enableCellIds(this, mode);
    }

    public final void enableContextMenu(MenuObject menu) {
        impl.enableContextMenu(this, menu);
    }

    public final void enableDragAndDrop(boolean mode) {
        impl.enableDragAndDrop(this, mode);
    }

    public final void enableDragOrder(boolean mode) {
        impl.enableDragOrder(this, mode);
    }

    public final void enableEditEvents(boolean click, boolean dblclick, boolean f2key) {
        impl.enableEditEvents(this, click, dblclick, f2key);
    }

    public final void enableEditTabOnly(boolean mode) {
        impl.enableEditTabOnly(this, mode);
    }

    public final void enableHeaderImages(boolean mode) {
        impl.enableHeaderImages(this, mode);
    }

    public final void enableKeyboardSupport(boolean mode) {
        impl.enableKeyboardSupport(this, mode);
    }

    public final void enableLightMouseNavigation(boolean mode) {
        impl.enableLightMouseNavigation(this, mode);
    }

    public final void enableMarkedCells(boolean mode) {
        impl.enableMarkedCells(this, mode);
    }

    public final void enableMultiline(boolean state) {
        impl.enableMultiline(this, state);
    }

    public final void enableMultiselect(boolean state) {
        impl.enableMultiselect(this, state);
    }

    public final void enableResizing(Boolean[] allowds) {
        impl.enableResizing(this, JavaScriptObjectHelper.convertToJsString(allowds));
    }

    public final void enableRowsHover(boolean state, String cssCls) {
        impl.enableRowsHover(this, state, cssCls);
    }

    public final void enableSmartRendering(boolean mode, int buffer) {
        impl.enableSmartRendering(this, mode, buffer);
    }

    public final void enableStableSorting(boolean mode) {
        impl.enableStableSorting(this, mode);
    }

    public final void enableTooltips(Boolean[] allowds) {
        impl.enableTooltips(this, JavaScriptObjectHelper.convertToJsString(allowds));
    }

    public final void forceLabelSelection(boolean mode) {
        impl.forceLabelSelection(this, mode);
    }

    public final JavaScriptObject getAllRowIds() {
        return impl.getAllRowIds(this);
    }

    public final JavaScriptObject getCheckedRows(int col_ind) {
        return impl.getCheckedRows(this, col_ind);
    }

    public final String getColIndexById(String id) {
        return impl.getColIndexById(this, id);
    }

    public final String getColType(int col_ind) {
        return impl.getColType(this, col_ind);
    }

    public final String getColTypeById(String id) {
        return impl.getColTypeById(this, id);
    }

    public final String getColWidth(int col_ind) {
        return impl.getColWidth(this, col_ind);
    }

    public final int getColWidthAsInteger(int col_ind) {
        return impl.getColWidthAsInteger(this, col_ind);
    }

    public final String getColumnId(int col_ind) {
        return impl.getColumnId(this, col_ind);
    }

    public final String getColumnLabel(int col_ind) {
        return impl.getColumnLabel(this, col_ind);
    }

    public final int getColumnsNum() {
        return impl.getColumnsNum(this);
    }

    public final JavaScriptObject getCombo(int col_ind) {
        return impl.getCombo(this, col_ind);
    }

    public final JavaScriptObject getCustomCombo(String row_id, int col_ind) {
        return impl.getCustomCombo(this, row_id, col_ind);
    }

    public final JavaScriptObject getFilterElement(int col_ind) {
        return impl.getFilterElement(this, col_ind);
    }

    public final String getFooterLabel(int col_ind, int frow_ind) {
        return impl.getFooterLabel(this, col_ind, frow_ind);
    }

    public final JavaScriptObject getMarked() {
        return impl.getMarked(this);
    }

    public final String getRowAttribute(String rowId, String name) {
        return impl.getRowAttribute(this, rowId, name);
    }

    public final String getRowId(int row_ind) {
        return impl.getRowId(this, row_ind);
    }

    public final int getRowIndex(String row_id) {
        return impl.getRowIndex(this, row_id);
    }

    public final int getRowsNum() {
        return impl.getRowsNum(this);
    }

    public final int getSelectedCellIndex() {
        return impl.getSelectedCellIndex(this);
    }

    public final String getSelectedRowId() {
        return impl.getSelectedRowId(this);
    }

    public final JavaScriptObject getSortingState() {
        return impl.getSortingState(this);
    }

    public final JavaScriptObject getStateOfView() {
        return impl.getStateOfView(this);
    }

    public final void hidePivot() {
        impl.hidePivot(this);
    }

    public final void init() {
        impl.init(this);
    }

    public final void load(String url, DataType type) {
        impl.load(this, url, type);
    }

    public final void lockRow(String row_id, boolean mode) {
        impl.lockRow(this, row_id, mode);
    }

    public final void mark(int row_ind, int cell_ind, boolean state) {
        impl.mark(this, row_ind, cell_ind, state);
    }

    public final void moveRowDown(String row_id) {
        impl.moveRowDown(this, row_id);
    }

    public final void moveRowUp(String row_id) {
        impl.moveRowUp(this, row_id);
    }

    public final void parse(String data, DataType type) {
        impl.parse(this, data, type);
    }

    public final void pasteBlockFromClipboard() {
        impl.pasteBlockFromClipboard(this);
    }

    public final void preventIECaching() {
        impl.preventIECaching(this);
    }

    public final void rowToDragElement(Image image, String row_id, int cell_ind) {
        impl.rowToDragElement(this, image, row_id, cell_ind);
    }

    public final void selectAll() {
        impl.selectAll(this);
    }

    public final void selectCell(String row_ind, int cell_ind, boolean call_onSelect, boolean preserve, boolean edit, boolean show) {
        impl.selectCell(this, row_ind, cell_ind, call_onSelect, preserve, edit, show);
    }

    public final void selectRow(int row_ind, boolean call_onSelect, boolean preserve, boolean show) {
        impl.selectRow(this, row_ind, call_onSelect, preserve, show);
    }

    public final void selectRowById(String row_id, boolean call_onSelect, boolean preserve, boolean show) {
        impl.selectRowById(this, row_id, call_onSelect, preserve, show);
    }

    public final void setAwaitedRowHeight(int height) {
        impl.setAwaitedRowHeight(this, height);
    }

    public final void setCSVDelimiter(char delimiter) {
        impl.setCSVDelimiter(this, delimiter);
    }

    public final void setCellTextStyle(String row_id, int cell_ind, String style) {
        impl.setCellTextStyle(this, row_id, cell_ind, style);
    }

    public final void setCheckedRows(int col_ind, boolean checked) {
        impl.setCheckedRows(this, col_ind, checked);
    }

    public final void setColAlign(String[] alignArray) {
        impl.setColAlign(this, JavaScriptObjectHelper.convertToJsString(alignArray));
    }

    public final void setColSorting(String[] sortingArray) {
        impl.setColSorting(this, JavaScriptObjectHelper.convertToJsString(sortingArray));
    }

    public final void setColTypes(String[] typesArray) {
        impl.setColTypes(this, JavaScriptObjectHelper.convertToJsString(typesArray));
    }

    public final void setColVAlign(String[] vAligns) {
        impl.setColVAlign(this, JavaScriptObjectHelper.convertToJsString(vAligns));
    }

    public final void setColWidth(int col_ind, String width) {
        impl.setColWidth(this, col_ind, width);
    }

    public final void setColumnColor(String[] colors) {
        impl.setColumnColor(this, JavaScriptObjectHelper.convertToJsString(colors));
    }

    public final void setColumnId(int col_ind, String id) {
        impl.setColumnId(this, col_ind, id);
    }

    public final void setColumnIds(String ids) {
        impl.setColumnIds(this, ids);
    }

    public final void setColumnLabel(int col_ind, String label, int h_row_ind) {
        impl.setColumnLabel(this, col_ind, label, h_row_ind);
    }

    public final void setColumnMinWidth(int width, int col_ind) {
        impl.setColumnMinWidth(this, width, col_ind);
    }

    public final void setColumnMinWidths(String[] minWidths) {
        impl.setColumnMinWidths(this, JavaScriptObjectHelper.convertToJsString(minWidths));
    }

    public final void setDelimiter(char delimiter) {
        impl.setDelimiter(this, delimiter);
    }

    public final void setDragBehavior(String mode) {
        impl.setDragBehavior(this, mode);
    }

    public final void setDragText(String single, String plural) {
        impl.setDragText(this, single, plural);
    }

    public final void setEditable(boolean mode) {
        impl.setEditable(this, mode);
    }

    public final void setExternalTabOrder(String start_id, String end_id) {
        impl.setExternalTabOrder(this, start_id, end_id);
    }

    public final void setFooterLabel(int col_ind, String label, int row_ind) {
        impl.setFooterLabel(this, col_ind, label, row_ind);
    }

    public final void setHeader(String[] headerArray) {
        impl.setHeader(this, JavaScriptObjectHelper.convertToJsString(headerArray));
    }

    public final void setIconPath(String path) {
        impl.setIconPath(this, path);
    }

    public final void setImagePath(String imagePath) {
        impl.setImagePath(this, imagePath);
    }

    public final void setInitWidths(String[] widthsArray) {
        impl.setInitWidths(this, JavaScriptObjectHelper.convertToJsString(widthsArray));
    }

    public final void setInitWidthsP(String[] widthsPrecent) {
        impl.setInitWidthsP(this, JavaScriptObjectHelper.convertToJsString(widthsPrecent));
    }

    public final void setNoHeader(boolean mode) {
        impl.setNoHeader(this, mode);
    }

    public final void setPagingSkin(String name) {
        impl.setPagingSkin(this, name);
    }

    public final void setRowAttribute(String row_id, String attributeName, String value) {
        impl.setRowAttribute(this, row_id, attributeName, value);
    }

    public final void setRowColor(String row_id, String color) {
        impl.setRowColor(this, row_id, color);
    }

    public final void setRowHidden(String row_id, boolean state) {
        impl.setRowHidden(this, row_id, state);
    }

    public final void setRowId(int row_ind, String row_id) {
        impl.setRowId(this, row_ind, row_id);
    }

    public final void setRowTextBold(String row_id) {
        impl.setRowTextBold(this, row_id);
    }

    public final void setRowTextNormal(String row_id) {
        impl.setRowTextNormal(this, row_id);
    }

    public final void setRowTextStyle(String row_id, String rowStyle) {
        impl.setRowTextStyle(this, row_id, rowStyle);
    }

    public final void setSkin(String skin) {
        impl.setSkin(this, skin);
    }

    public final void setSortImgState(boolean state, int col_ind, String order, int row) {
        impl.setSortImgState(this, state, col_ind, order, row);
    }

    public final void setStyle(String headerStyle, String cellsStyle, String selectedCellStyle, String selectedRowStyle) {
        impl.setStyle(this, headerStyle, cellsStyle, selectedCellStyle, selectedRowStyle);
    }

    public final void setTabOrder(String tabOrder) {
        impl.setTabOrder(this, tabOrder);
    }

    public final void showRow(String row_id) {
        impl.showRow(this, row_id);
    }

    public final void sortRows(int col_ind, String sortType, String sortOrder) {
        impl.sortRows(this, col_ind, sortType, sortOrder);
    }

    public final void startFastOperations() {
        impl.startFastOperations(this);
    }

    public final void stopFastOperations() {
        impl.stopFastOperations(this);
    }

    public final void submitAddedRows(boolean mode) {
        impl.submitAddedRows(this, mode);
    }

    public final void submitOnlyChanged(boolean mode) {
        impl.submitOnlyChanged(this, mode);
    }

    public final void submitOnlyRowID(boolean mode) {
        impl.submitOnlyRowID(this, mode);
    }

    public final void submitOnlySelected(boolean mode) {
        impl.submitOnlySelected(this, mode);
    }

    public final void submitSerialization(boolean mode) {
        impl.submitSerialization(this, mode);
    }

    public final String uid() {
        return impl.uid(this);
    }

    public final void uncheckAll() {
        impl.uncheckAll(this);
    }

    public final void unmarkAll() {
        impl.unmarkAll(this);
    }

    public final void updateFromXML(String url, boolean insert_new_item, boolean del_missed, boolean forceEvent) {
        impl.updateFromXML(this, url, insert_new_item, del_missed, forceEvent);
    }
}
